home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KDChartParamsWrapper.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  8.3 KB  |  176 lines

  1. #ifndef KDCHARTPARAMSWRAPPER_H
  2. #define KDCHARTPARAMSWRAPPER_H
  3. #include <qobject.h>
  4. #include <KDFrame.h>
  5. #include <KDChartParams.h>
  6. #include <qvariant.h>
  7. class KDChartAxisParams;
  8.  
  9. class KDChartParamsWrapper :public QObject
  10. {
  11.     Q_OBJECT
  12.  
  13. public:
  14.     KDChartParamsWrapper( KDChartParams* );
  15. public slots:
  16.     const KDChartAxisParams* axisParams( uint n ) const;
  17.     void setExplodeValues( QVariant explodeList );
  18.     void setExplodeFactors( QVariant factors );
  19.     void setAxisLabelStringParams( uint n,
  20.                                    QVariant axisLabelStringList,
  21.                                    QVariant axisShortLabelStringList,
  22.                                    const QString& valueStart = QString::null,
  23.                                    const QString& valueEnd   = QString::null );
  24.  
  25.     // These methods need to be here, for the enums to work.
  26.     void setSimpleFrame( uint        area,
  27.                          int         outerGapX = 0,
  28.                          int         outerGapY = 0,
  29.                          int         innerGapX = 0,
  30.                          int         innerGapY = 0,
  31.                          bool        addFrameWidthToLayout      = true,
  32.                          bool        addFrameHeightToLayout     = true,
  33.                          int         simpleFrame    = KDFrame::FrameFlat,
  34.                          int                     lineWidth      = 1,
  35.                          int                     midLineWidth   = 0,
  36.                          QPen                    pen            = QPen(),
  37.                          QBrush                  background     = QBrush( Qt::NoBrush ),
  38.                          const QPixmap*          backPixmap     = 0, // no pixmap
  39.                          int backPixmapMode = KDFrame::PixStretched,
  40.                          int                     shadowWidth    = 0,
  41.                          int                     sunPos         = KDFrame::CornerTopLeft )
  42.         {
  43.             _data->setSimpleFrame(area, outerGapX, outerGapY, innerGapX, innerGapY, addFrameWidthToLayout, addFrameHeightToLayout,
  44.                                   (KDFrame::SimpleFrame) simpleFrame, lineWidth, midLineWidth, pen, background, backPixmap,
  45.                                   (KDFrame::BackPixmapMode) backPixmapMode, shadowWidth, (KDFrame::CornerName) sunPos );
  46.         }
  47.  
  48.     void setDataRegionFrame( uint dataRow,
  49.                              uint dataCol,
  50.                              uint data3rd, // important: we ignore the data3rd parameter for now!
  51.                              int  innerGapX = 0,
  52.                              int  innerGapY = 0,
  53.                              bool addFrameWidthToLayout      = true,
  54.                              bool addFrameHeightToLayout     = true,
  55.                              int  simpleFrame    = KDFrame::FrameFlat,
  56.                              int  lineWidth      = 1,
  57.                              int  midLineWidth   = 0,
  58.                              QPen pen            = QPen(),
  59.                              int  shadowWidth    = 0,
  60.                              int  sunPos         = KDFrame::CornerTopLeft )
  61.         {
  62.             _data->setDataRegionFrame( dataRow, dataCol,
  63.                                        data3rd, innerGapX, innerGapY, addFrameWidthToLayout, addFrameHeightToLayout,
  64.                                        (KDFrame::SimpleFrame) simpleFrame, lineWidth, midLineWidth, pen, shadowWidth, (KDFrame::CornerName) sunPos );
  65.         }
  66.  
  67.     bool moveDataRegionFrame( uint oldDataRow,
  68.                              uint oldDataCol,
  69.                              uint oldData3rd, // important: we ignore the data3rd parameter for now!
  70.                              uint newDataRow,
  71.                              uint newDataCol,
  72.                              uint newData3rd// important: we ignore the data3rd parameter for now!
  73.                              )
  74.     {
  75.         return _data->moveDataRegionFrame(
  76.             oldDataRow, oldDataCol, oldData3rd, newDataRow, newDataCol, newData3rd );
  77.     }
  78.  
  79.     void setPrintDataValues( bool active,
  80.                              uint chart = KDCHART_ALL_CHARTS,
  81.                              int divPow10 = 0,
  82.                              int digitsBehindComma = KDCHART_DATA_VALUE_AUTO_DIGITS,
  83.                              QFont* font   = 0,
  84.                              uint size     = UINT_MAX, //  <-- makes us use the *default* font params
  85.                              //                                by IGNORING settings of
  86.                              //                                the following parameters!
  87.                              const QColor* color = KDCHART_DATA_VALUE_AUTO_COLOR,
  88.                              int negativePosition = KDChartEnums::PosCenter,
  89.                              uint negativeAlign    = Qt::AlignCenter,
  90.                              int  negativeDeltaX   =    0,
  91.                              int  negativeDeltaY   =    0,
  92.                              int  negativeRotation =    0,
  93.                              int positivePosition = KDChartEnums::PosCenter,
  94.                              uint positiveAlign    = Qt::AlignCenter,
  95.                              int  positiveDeltaX   =    0,
  96.                              int  positiveDeltaY   =    0,
  97.                              int  positiveRotation =    0,
  98.                              int policy = KDChartEnums::LayoutPolicyRotate )
  99.         {
  100.             _data->setPrintDataValues( active, chart, divPow10, digitsBehindComma,font, size, color, (KDChartEnums::PositionFlag) negativePosition,
  101.                                        negativeAlign, negativeDeltaX, negativeDeltaY, negativeRotation, (KDChartEnums::PositionFlag) positivePosition,
  102.                                        positiveAlign, positiveDeltaX, positiveDeltaY, positiveRotation, (KDChartEnums::TextLayoutPolicy) policy );
  103.         }
  104.  
  105.  
  106.     void setDataValuesPlacing( int position,
  107.                                uint align,
  108.                                int  deltaX,
  109.                                int  deltaY,
  110.                                int  rotation,
  111.                                bool specifyingPositiveValues = true,
  112.                                uint chart = KDCHART_ALL_CHARTS )
  113.         {
  114.             _data->setDataValuesPlacing( (KDChartEnums::PositionFlag) position, align, deltaX, deltaY, rotation, specifyingPositiveValues, chart );
  115.         }
  116.  
  117.  
  118.     void setDataValuesPolicy( int policy = KDChartEnums::LayoutPolicyRotate,
  119.                               uint chart = KDCHART_ALL_CHARTS )
  120.         {
  121.             _data->setDataValuesPolicy( (KDChartEnums::TextLayoutPolicy) policy, chart );
  122.         }
  123.  
  124.  
  125.     void setPolarDelimsAndLabelsAtPos( int pos,
  126.                                        bool showDelimiters,
  127.                                        bool showLabels )
  128.         {
  129.             _data->setPolarDelimsAndLabelsAtPos( (KDChartEnums::PositionFlag) pos, showDelimiters, showLabels );
  130.         }
  131.  
  132.  
  133.     bool polarDelimAtPos( int pos ) const
  134.         {
  135.             return _data->polarDelimAtPos( (KDChartEnums::PositionFlag) pos );
  136.         }
  137.  
  138.  
  139.  
  140.     bool polarLabelsAtPos( int pos ) const
  141.         {
  142.             return _data->polarLabelsAtPos( (KDChartEnums::PositionFlag) pos );
  143.         }
  144.  
  145.  
  146.     void setAxisType( uint n, int axisType )
  147.         {
  148.             _data->setAxisType( n, (KDChartAxisParams::AxisType) axisType );
  149.         }
  150.  
  151.  
  152.     void setAxisLabelTextParams( uint n,
  153.                                  bool axisSteadyValueCalc   = true,
  154.                                  QVariant axisValueStart = KDCHART_AXIS_LABELS_AUTO_LIMIT,
  155.                                  QVariant axisValueEnd   = KDCHART_AXIS_LABELS_AUTO_LIMIT,
  156.                                  double axisValueDelta      = KDCHART_AXIS_LABELS_AUTO_DELTA,
  157.                                  int axisDigitsBehindComma  = KDCHART_AXIS_LABELS_AUTO_DIGITS,
  158.                                  int axisMaxEmptyInnerSpan  = 67,
  159.                                  int takeLabelsFromDataRow  = KDChartAxisParams::LabelsFromDataRowNo,
  160.                                  int labelTextsDataRow      = 0,
  161.                                  const QVariant& axisLabelStringList = QStringList(),
  162.                                  const QVariant& axisShortLabelsStringList = QStringList(),
  163.                                  int axisValueLeaveOut      = KDCHART_AXIS_LABELS_AUTO_LEAVEOUT,
  164.                                  int axisValueDeltaScale = KDChartAxisParams::ValueScaleNumerical );
  165.  
  166.  
  167.  
  168. private:
  169.     KDChartParams* _data;
  170. };
  171.  
  172.  
  173.  
  174. #endif /* KDCHARTPARAMSWRAPPER_H */
  175.  
  176.